// =============================================================================
//  STATS - Statistical Analysis Tools, v.0.01
//  Copyright (C) 2012  Marco Vettigli
// -----------------------------------------------------------------------------
//
// This program  is free software:  you can  redistribute it and/or  modify it
// under the terms of the  GNU General Public License as published by the Free
// Software Foundation,  either version 3 of the License,  or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY;  without even  the  implied  warranty  of  MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License  for
// more details.
//
// You  should  have received a copy of the  GNU General Public License  along
// with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// =============================================================================
//
// DIALOGINSERTROWS.H
// The class defines a graphical user interface for multiple row insertion.
//
// Author: Marco Vettigli
//
// =============================================================================

#ifndef DIALOGINSERTROWS_H
#define DIALOGINSERTROWS_H

// == include directives =======================================================

#include <QDialog>
#include "core/scolproperty.h"

// == class definitions ========================================================

namespace Ui {
    class DialogInsertRows;
}

class DialogInsertRows : public QDialog
{

    Q_OBJECT

public:

// == constructors and destructors =============================================


    // -- public ---------------------------------------------------------------
    // DialogInsertRows::DialogInsertRows(QWidget*)
    //
    // Default constructor for DialogInsertRows class.
    //
    // -------------------------------------------------------------------------
    explicit DialogInsertRows(QWidget *parent = 0);

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::~DialogInsertRows()
    //
    // Default destructor for DialogInsertRows class.
    //
    // -------------------------------------------------------------------------
    ~DialogInsertRows();

// == enums ====================================================================

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::Position
    //
    // Enum to define row insertion position.
    //
    // -------------------------------------------------------------------------
    enum Position { Begin, End, AfterSelected, BeforeSelected };

// == getters ==================================================================

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::getRowNumber()
    //
    // Returns the number of row to be inserted present in spin box "number".
    //
    // -------------------------------------------------------------------------
    int getRowNumber() const;

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::getInsertionPosition()
    //
    // Returns the insertion position depenging on dialog checkboxes status.
    //
    // -------------------------------------------------------------------------
    DialogInsertRows::Position getInsertionPosition() const;

// == setters ==================================================================

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::setRowNumber(int)
    //
    // The function sets the number of row to be inserted in spin box "number"
    // by 'number' argument. The variable 'number' must be equal or greater
    // than one.
    //
    // -------------------------------------------------------------------------
    bool setRowNumber(int number);

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::setInsertionPosition(DialogInsertRows::Position)
    //
    // The function sets the insertion position of the dialog based on
    // Position 'pos'.
    //
    // -------------------------------------------------------------------------
    bool setInsertionPosition(DialogInsertRows::Position pos);

// == inspectors ===============================================================

// == accessor function declarations ===========================================

// == variable declarations ====================================================

private:

    Ui::DialogInsertRows *ui;       // user interface pointer

// == private function declarations ============================================

private slots:

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::on_buttonBox_accepted()
    //
    // The function handles click of "OK" button.
    //
    // -------------------------------------------------------------------------
    void on_buttonBox_accepted();

    // -- public ---------------------------------------------------------------
    // DialogInsertRows::on_buttonBox_rejected()
    //
    // The function handles click of "Cancel" button.
    //
    // -------------------------------------------------------------------------
    void on_buttonBox_rejected();

};

#endif // DIALOGINSERTROWS_H
